﻿namespace ConsoleApp7.Server
{
    using Dapper;
    using Microsoft.Data.SqlClient;
    using System.Threading.Tasks;
    using WebApplication9.Controllers;
    using WebApplication9.Server;

    public class Sj: ISj
    {
        private readonly IConfiguration _configuration;
        public Sj( IConfiguration configuration)
        {
            _configuration = configuration;
        }
        public async Task<string> sjcl() 
        {
            using (SqlConnection con = new SqlConnection(_configuration["sql"])) 
            {
                
                string sql = "insert into Admins1 values('赵六','123',1)";
                int result = await con.ExecuteAsync(sql);
                string sql2 = "update Admins1 set UserName='zl' where UserID=8";
                int result1 = await con.ExecuteAsync(sql);
                if (result == 1 && result1 == 1)
                {

                    return "ok";
                }
                else
                {
                    return "nook";
                }
            }
                
        }
    }
}
